package by.grsu.hdm.model;

public abstract class HomeDevice implements IHomeDevice {

	public String id;				//public!

	public HomeDeviceStatus status; //public!

	abstract public void defaultConfiguration();

	public void beforeTurningOn() { }

	public void afterTurningOff() { }

	public HomeDevice(){
		
	}
	
	public HomeDevice(String id) {
		this.id = id;
		status = new HomeDeviceStatus("The device "
				+ getDeviceId() + " is ready for use" + " ");
	}

	@Override
	public void turnOn() {
		beforeTurningOn();
		status = new HomeDeviceStatus("The device "
				+ getDeviceId() + " is turned on" + " ");
	}

	@Override
	public void turnOff() {
		afterTurningOff();
		status = new HomeDeviceStatus("The device "
				+ getDeviceId() + " is turned off" + " ");
	}

	public String getDeviceId() {
		return id;
	}

	public HomeDeviceStatus getHomeDeviceStatus() {
		return status;
	}

}
